package org.chen.controller;

import org.chen.common.UserQuery;
import org.chen.common.UserWithChat;
import org.chen.dto.FindPasswordDto;
import org.chen.result.BaseResponse;
import org.chen.result.CommonResponse;
import org.chen.result.FindPasswordResponse;
import org.chen.result.ResultBody;
import org.chen.service.UserQueryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/userQuery")
public class UserQueryController {
    @Autowired
    private UserQueryService userQueryService;

    @PostMapping("/loadDates")
    private ResultBody<BaseResponse<List<UserQuery>>> loadDates(@RequestBody UserQuery userQuery){
        return ResultBody.success(userQueryService.loadDates(userQuery));
    }

    @PostMapping("/loadDatesByDate")
    private ResultBody<BaseResponse<List<UserQuery>>> loadDatesByDate(@RequestBody UserQuery userQuery){
        return ResultBody.success(userQueryService.loadDatesByDate(userQuery));
    }

    @PostMapping("/saveUserQuery")
    private ResultBody<CommonResponse> saveUserQuery(@RequestBody UserQuery userQuery){
        return ResultBody.success(userQueryService.saveUserQuery(userQuery));
    }


}
